﻿#!/usr/bin/env python3

import threading
import time
import logging

def timerFunc():
    logging.debug("hit")



def main():
    '''
timer在规定时间后启动一个thread.

'''
    logging.basicConfig(
        level = logging.DEBUG,
        format='(%(threadName)-10s) %(message)s'
    )
    t = threading.Timer(1, timerFunc)
    t.setName("timer")
    logging.debug("start timer")
    t.start()
    logging.debug("started")



if __name__=='__main__':
    main()
